package com.heima.admin.controller;

import com.heima.admin.dto.LoginDto;
import com.heima.admin.service.IAdUserService;
import com.heima.common.dto.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: LoginController
 * @time: 2022/6/26
 */
@RestController
@RequestMapping("/login")
@Api(tags = "admin管理员登录")
public class LoginController {

    @Autowired
    private IAdUserService adUserService;

    @PostMapping("/in")
    @ApiOperation(value = "login",notes = "admin管理员登录")
    @ApiModelProperty(name = "dto",dataType = "LoginDto",required = true)
    public ResponseResult login(@RequestBody LoginDto dto){
        return adUserService.login(dto);
    }
}
